import { PrismaClient } from '@prisma/client';
import { UpdateUserInput } from '../dto/user.dto';

const prisma = new PrismaClient();

export const getUserById = async (id: number) => {
  return prisma.users.findUnique({ where: { id } });
};

export const updateUser = async (id: number, data: UpdateUserInput) => {
  return prisma.users.update({
    where: { id },
    data
  });
};
